module.exports = function (sequelize, Sequelize) {
	// 评价模型：验证会自动在 create, update 和 save 时运行
	return sequelize.define("CollectionModel", {
		id: { 
			type: Sequelize.INTEGER, 
			primaryKey: true,
			autoIncrement: true,
			allowNull: false
		},
		good_id: {
			type: Sequelize.INTEGER,
			allowNull:false,
			validate: {
				isInt: true,
				notNull: true
			},
		},
		user_id: {
			type: Sequelize.INTEGER,
			allowNull:false,
			validate: {
				isInt: true,
				notNull: true
			},
		},
		add_time: { 
			type: Sequelize.INTEGER, 
			defaultValue: parseInt(Date.now() / 1000) 
		},
	}, {
		tableName: "collection"
	});
}